<?php

require_once dirname(__FILE__) . '/../Query.php';

class Rams_ConcurrentQuery extends RawsQuery
{
  public function __construct($from = null, $until = null)
  {
      parent::__construct();
      $this->setFrom($from);
      $this->setUntil($until);
  }

  public function setPaginateBy($value)
  {
    if ($value !== null) {
        $this->_params['paginate_by'] = $value;
    } else {
        unset($this->_params['paginate_by']);
    }
    return $this;
  }

  public function setPage($value)
  {
    if ($value !== null) {
        $this->_params['page'] = $value;
    } else {
        unset($this->_params['page']);
    }
    return $this;
  }
  
  public function setFrom($value)
  {
    if ($value !== null) {
        $this->_params['from'] = $value;
    } else {
        unset($this->_params['from']);
    }
    return $this;
  }

  public function setUntil($value)
  {
    if ($value !== null) {
        $this->_params['until'] = $value;
    } else {
        unset($this->_params['until']);
    }
    return $this;
  }

  public function setType($value)
  {
    if ($value !== null) {
        $this->_params['type'] = $value;
    } else {
        unset($this->_params['type']);
    }
    return $this;
  }

  public function getQueryUrl($base_uri = null, $resource = null, $path = null)
  {
    return parent::getQueryUrl($base_uri, "concurrent", $path);
  }

}
